﻿//#define LISTSERIES
//#define GETIMAGE
//#define SAVEING


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SerieInterface;
using MyInteractiveSerieList;
using System.Drawing;
using System.Diagnostics;

namespace TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            Stopwatch stopWatch = new Stopwatch();
            #if (DEBUG)
                ClearAllPropertiesDebug clear = new ClearAllPropertiesDebug();
                clear.ClearAll();
            #endif
            #if (LISTSERIES)
                IListSerie ls = new ListSerie();
                ls.addToSeriePath("F:\\");
                ls.addToSeriePath("F:\\Avklarade");
                List<ISerieInfo> serielist = ls.getListOfSeries();
                foreach (var serie in serielist)
                {
                    Console.WriteLine(serie.ToString());
                }
                Console.WriteLine();
                Console.WriteLine();
                ls.removeFromSeriePath("F:\\");
                serielist = ls.getListOfSeries();
                foreach (var serie in serielist)
                {
                    Console.WriteLine(serie.ToString());
                }
                
                Console.WriteLine();
                Console.WriteLine();

                ls.removeFromSeriePath("F:\\");
                Console.WriteLine(ls.getSeriePath());
                ls.removeFromSeriePath("F:\\Avklarade");
                Console.WriteLine(ls.getSeriePath());
                ls.addToSeriePath("F:\\Avklarade");
                ls.addToSeriePath("F:\\");
                ls.removeFromSeriePath("F:\\");
                Console.WriteLine(ls.getSeriePath());

                Console.ReadKey();

            #elif (GETIMAGE)
                GetImages gI = new GetImages();
                IListSerie ls = new ListSerie();
                ls.addToSeriePath("F:\\");
                ls.addToSeriePath("F:\\Avklarade");
                List<ISerieInfo> serielist = ls.getListOfSeries();
                stopWatch.Start();
                foreach (var serie in serielist)
                {
                    Image img = gI.GetImage(serie.SerieName);
                }                
                stopWatch.Stop();
                Console.WriteLine("Time elapsed: " + stopWatch.ElapsedMilliseconds);

                Console.ReadKey();
            #elif (SAVEING)
                IListSerie ls = new ListSerie();
                Console.WriteLine(ls.getSeriePath());
                ls.addToSeriePath("F:\\");

                IIOControl io = new IOControl();
                Console.WriteLine(io.Load("Bones"));
                io.Save("06", "01", "Bones");
                Console.WriteLine(io.Load("Bones"));
                io.Save("06", "23", "Bones");
                Console.WriteLine(io.Load("Bones"));
                
                Console.WriteLine(io.Load("House"));
                io.Save("03", "08", "House");
                Console.WriteLine(io.Load("House"));

                Console.WriteLine(io.Load("Criminal Minds"));
                io.Save("05", "08", "Criminal Minds");
                Console.WriteLine(io.Load("Criminal Minds"));

                Console.WriteLine(io.Load("Äkta Människor"));
                io.Save("01", "08", "True Blood");
                Console.WriteLine(io.Load("True Blood"));

                io.Save("01", "08", "Heroes");
                Console.WriteLine(io.Load("Heroes"));

                Console.ReadKey();

            #endif




        }
    }
}
